From daa43e77ba71dabea5cd4e2ca20b60ec0fa0fd4f Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 23 Jun 2009 03:14:21 +0000 Subject: [PATCH] Add depth support to Garmin proprietary data that's tracked. --- garmin.c | 6 +++++- gpx.c | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/garmin.c b/garmin.c index 7737aadfa..f25ae9f39 100644 --- a/garmin.c +++ b/garmin.c @@ -468,7 +468,11 @@ track_read(void) wpt->creation_time = array[i]->Time; wpt->wpt_flags.is_split = checkWayPointIsAtSplit(wpt, laps, nlaps); - + if (array[i]->dpth < 1.0e25f) + WAYPT_SET(wpt, depth, array[i]->dpth); + if (array[i]->temperature_populated) + WAYPT_SET(wpt, temperature, array[i]->temperature); + track_add_wpt(trk_head, wpt); } diff --git a/gpx.c b/gpx.c index a8e98e51d..e89b994f2 100644 --- a/gpx.c +++ b/gpx.c @@ -1595,15 +1595,25 @@ gpx_write_common_position(const waypoint *waypointp, const char *indent) static void gpx_write_common_depth(const waypoint *waypointp, const char *indent) { - if (waypointp->depth != 0) { + if (waypointp->depth != 0 || waypointp->temperature != 0) { if (opt_humminbirdext || opt_garminext) { gbfprintf(ofd, "%s\n", indent); - if (opt_humminbirdext) - gbfprintf(ofd, "%s %f\n", - indent, waypointp->depth*100.0); - if (opt_garminext) - gbfprintf(ofd, "%s %f\n", - indent, waypointp->depth); + if (waypointp->depth != 0) { + if (opt_humminbirdext) + gbfprintf(ofd, "%s %f\n", + indent, waypointp->depth*100.0); + if (opt_garminext) + gbfprintf(ofd, "%s %f\n", + indent, waypointp->depth); + } + if (waypointp->temperature != 0) { + if (opt_humminbirdext) + gbfprintf(ofd, "%s %f\n", + indent, waypointp->temperature); + if (opt_garminext) + gbfprintf(ofd, "%s %f\n", + indent, waypointp->temperature); + } gbfprintf(ofd, "%s\n", indent); } } -- 2.30.2